"""
PyLink-SR (Python Linked Software Radio System)
(c) Bob Cowdery (G3UKB) 2008

File: models.py
Date: November 2008

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

The author can be reached by email at

bob@g3ukb.co.uk

========================================================================
Module Description:

The radio state model.

"""

from django.db import models

#-------------------------------------------------------------------------------

MODE_CHOICES = (
    ('LSB', 'Lower Sideband'),
    ('USB', 'Upper Sideband'),
    ('CW-L', 'Lower Sideband'),
    ('CW-U', 'Upper Sideband'),
    ('AM', 'Amplitude Modulation'),
    ('FM-N', 'Narrow Frequency Modulation')
)

FILTER_CHOICES = (
    ('6K0', '6 KHz'),
    ('2K4', '2.4 KHz'),
    ('2K1', '2.1 KHz'),
    ('1K0', '1.0 KHz'),
    ('500', '500 Hz'),
    ('250', '250 Hz'),
    ('100', '100 Hz'),
)
   
AGC_CHOICES = (
    ('AGC_FAST', 'AGC FAST'),
    ('AGC_MEDIUM', 'AGC MEDIUM'),
    ('AGC_SLOW', 'AGC SLOW')
)
    
class State(models.Model):
    frequency = models.FloatField()
    mode = models.CharField(max_length=4, choices=MODE_CHOICES)
    filter = models.CharField(max_length=3, choices=FILTER_CHOICES)
    agc_state = models.BooleanField()
    agc_rate = models.CharField(max_length=10, choices=AGC_CHOICES)

